function varargout = plot(obj,varargin)

    data    = get(obj,'data');
    popt    = get(obj,'plotting');
    fitData = get(obj,'fitting');
   
    isfigure
    
    p_handle = zeros(length(data),1);
    f_handle = zeros(0,1);
    hold on
    for i=1:length(data)
        x = get(data(i),'x');
        y = get(data(i),'y');
        e = get(data(i),'e');
        
        if ~isempty(varargin)
            sp_data(popt(i),struct(varargin{:}))
        end
        
        p_handle(i)=errorbar(x,y,e);
        set(data(i),'line_hand',p_handle(i));
        set(popt(i),'line_hand',p_handle(i));
    end
    hold off
    
    xlabel(get(data(1),'x_label'),'fontname','Helvetica','Fontsize',14)
    ylabel(get(data(1),'y_label'),'fontname','Helvetica','Fontsize',14)
    title (get(data(1),'name'),'fontname','Helvetica','Fontsize',14)
    
    
    makeNice
    
    switch nargout
        case 1
            varargout{1} = p_handle;
        case 2
            varargout{1} = p_handle;
            varargout{2} = f_handle;
    end
end

function makeNice
    if ismac
        % For some reason this looks crap on a mac
        set(gca,'Xgrid','on','Ygrid','on','Box','On','LineWidth',1);
    else
        set(gca,'Xgrid','on','Ygrid','on','Box','On','LineWidth',2);
    end
end

function isfigure
    c_win=get(0,'CurrentFigure');
    if isempty(c_win)
        c_win=figure;
    end
    s=struct('Figure',c_win);
    set(c_win,'UserData',s);
end